/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	EventInputs.h
*
*	Description -	Collection of Device Input type events. 
*
*	Comments	-
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	04/25/2013	-	Creation of this file
**************************************************************************************/

#ifndef _PSX_EVENT_INPUTS_H_
#define _PSX_EVENT_INPUTS_H_

#include "PulseSTD.h"
#include "IEvent.h"

namespace Pulse
{
	// Keyboard input events
	////////////////////////

	class EventKeyboardInput : public IEvent
	{
	public:

		EventKeyboardInput( const UINT key = 0 ) : IEvent(), m_key( key ) { }

		virtual const EEvent::Type GetEventType( void ) const = 0;

		void SetKey( const UINT key ) { m_key = key; }

		const UINT GetKey( void ) const { return m_key; }

	protected:

		UINT m_key;
	};

	class EventKeyUp : public EventKeyboardInput
	{
	public:

		EventKeyUp( void ) : EventKeyboardInput() { }

		virtual const EEvent::Type GetEventType( void ) const { return EEvent::INPUT_KEY_UP; }

	private:

	};

	class EventKeyDown : public EventKeyboardInput
	{
	public:

		EventKeyDown( void ) : EventKeyboardInput() { }

		virtual const EEvent::Type GetEventType( void ) const { return EEvent::INPUT_KEY_DOWN; }

	private:

	};

	// Mouse input events
	//////////////////////

	class EventMouseMove : public IEvent
	{
	public:

		EventMouseMove( const LONG posX = 0, const LONG posY = 0, const LONG deltaX = 0, const LONG deltaY = 0 ) 
			: IEvent(), m_posX( posX ), m_posY( posY ), m_deltaX( deltaX ), m_deltaY( deltaY ) 
		{
		}

		virtual const EEvent::Type GetEventType( void ) const { return EEvent::INPUT_MOUSE_MOVE; }

		void SetPosition( const LONG posX, const LONG posY ) { m_posX = posX; m_posY = posY; }

		void SetDeltaPosition( const LONG deltaX, const LONG deltaY ) { m_deltaX = deltaX; m_deltaY = deltaY; }

		const LONG GetPosX( void ) const { return m_posX; }

		const LONG GetPosY( void ) const { return m_posY; }

		const LONG GetDeltaX( void ) const { return m_deltaX; }

		const LONG GetDeltaY( void ) const { return m_deltaY; }
	
	private:

		LONG m_posX;
		LONG m_posY;

		LONG m_deltaX;
		LONG m_deltaY;
	};

	PSX_EnumBegin( EMouseButton )
		UNKNOWN = -1,
		LEFT_BUTTON,
		MIDDLE_BUTTON,
		RIGHT_BUTTON,
	PSX_EnumEnd()

	class EventMouseButtonUp : public IEvent
	{
	public:

		EventMouseButtonUp( void ) : IEvent(), m_button( EMouseButton::UNKNOWN ) { }

		virtual const EEvent::Type GetEventType( void ) const { return EEvent::INPUT_MOUSE_BUTTONUP; }

		void SetMouseButton( const EMouseButton::Type button ) { m_button = button; }

		const EMouseButton::Type GetMouseButton( void ) const { return m_button; }

	private:

		EMouseButton::Type m_button;
	};

	class EventMouseButtonDown : public IEvent
	{
	public:

		EventMouseButtonDown( void ) : IEvent(), m_button( EMouseButton::UNKNOWN ) { }

		virtual const EEvent::Type GetEventType( void ) const { return EEvent::INPUT_MOUSE_BUTTONDOWN; }

		void SetMouseButton( const EMouseButton::Type button ) { m_button = button; }

		const EMouseButton::Type GetMouseButton( void ) const { return m_button; }

	private:

		EMouseButton::Type m_button;
	};

}

#endif /* _PSX_EVENT_INPUTS_H_ */